// All source files and native code may not be transmitted, reproduced, distributed, 
// or commercially exploited in any way without the express written consent of Sybex Inc.

//MOST THINGS THAT CHANGE

//CHAPTER TITLE
var TestChapter:String = "Chapter 5";

var user_Correct:Array = new Array("C","A","B","D","C","BCD","A","A","A","C","D","D","C","CD","D","D","A","B","C","D");

total = user_Correct.length;
_root.countdown = false;
// set to false to make the timer count up //
_root.hour = 0;
// number of hours at start//
_root.minute = 0;
// number of minutes at start//
//DON'T FORGET THE QUESTIONS AT THE END
//END OF MOST THINGS THAT CHANGE
//
//
//The following is used in the timer mc for adjusting the clock.
_root.delay = false;
_root.wait = 60;
//wait in seconds
_root.lastTime = Math.floor(getTimer()/1000);
i = 1;
totalCorrect = 0;
totalWrong = 0;
QCounter.QTotal.text = total;
Test_Title.text = TestChapter;
var finalCorrect:Number;
var userResponse:Array = new Array(total);
var markResponse:Array = new Array(total);
user_responseA = "";
user_responseB = "";
user_responseC = "";
user_responseD = "";
user_responseE = "";
user_responseF = "";
user_responseG = "";
user_responseH = "";
user_responseI = "";
user_responseJ = "";
user_responseK = "";
user_responseL = "";
user_responseM = "";
user_responseN = "";
_root.review = false;

function initialize() {
	_root.review = false;
	for (j=0; j<total; j++) {
		userResponse[j] = "";
		markResponse[j] = "";
	}
	
}

function showMatch() {
	set("user_response"+i, user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN);
	userResponse[i-1] = user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN;
}

// display multiple choice user_response answer function
function display() {
	set("user_response"+i, user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN);
	userResponse[i-1] = user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN;

	//**NEW
	response.text = userResponse[i-1];
	
}

//radio button function
function answer(choice) {
	set("user_response"+i, choice);
	userResponse[i-1] = choice;
	
	//**NEW
	response.text = userResponse[i-1];	
}

// marker button fuction
function mark(choice) {
	_root["mark"+i] = choice;
	markResponse[i-1] = choice;
}

// display fill in the blank by user.
function submit(userInput) {
	_root["user_response"+i] = userInput;
}

function reset() {
	_root["user_response"+i] = "";
}

function UnloadReview() {
	//ReviewLinks.unloadMovie();
}


function LayoutQuestion() {

	qname = "q"+(_root._currentframe-1);
	
	markname = "m"+(_root._currentframe-1);
	
	_root.loadQuestion(_root._currentframe-1);	
	
	_root.createEmptyMovieClip("container", 1);

	_root.attachMovie("Marker_mc", markname, 2, {_x:65.4, _y:55.4});
	
	if (_root.question_type == "2R") { this.attachMovie("2R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "3R") { this.attachMovie("3R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "3MC") { this.attachMovie("3MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "4R") { this.attachMovie("4R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "4MC") { this.attachMovie("4MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "5R") { this.attachMovie("5R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "5MC") { this.attachMovie("5MC", qname, 1, {_x:24, _y:165}); }	
	if (_root.question_type == "6R") { this.attachMovie("6R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "6MC") { this.attachMovie("6MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "7R") { this.attachMovie("7R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "7MC") { this.attachMovie("7MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "8R") { this.attachMovie("8R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "8MC") { this.attachMovie("8MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "9R") { this.attachMovie("9R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "9MC") { this.attachMovie("9MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "10R") { this.attachMovie("10R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "10MC") { this.attachMovie("10MC", qname, 1, {_x:24, _y:165}); }


	if (_root.review == false) { _root.attachMovie("show_answer", "show_answer1", 3, {_x:72, _y:418}); }
	if (_root.review == true)  { _root.attachMovie("show_review", "show_review1", 3, {_x:72, _y:418}); }
        if (_root.figure_flag == "True") { _root.attachMovie("show_figure", "show_figure1", 6, {_x:72, _y:418}); }
        if (_root.figure_flag == "False") { _root.createEmptyMovieClip("container", 6); }        

	question_scroll._visible = (question_text.maxscroll > 1);
	question_scroll.setSize(85,16); 
	
	//**NEW
	response.text = userResponse[i-1];
}

function loadQuestion(inNum:Number) {
	var cur:Number = inNum;
	//This corrects for the first frame holding all functions
	//QUESTIONS AND ANSWERS CAN ACCEPT HTML FORMATTING!!!
	//EACH QUESTION SHOULD BE FORMATTED SIMILAR TO THE FOLLOWING.

	switch (cur) {
case 1 :
_root.question = "IEEE 802.11a/b/g devices use what type of communication?";
_root.answerA = "Half diplex";
_root.answerB = "Full diplex";
_root.answerC = "Half duplex";
_root.answerD = "Full duplex";
_root.correct = "C";
_root.explanation = "IEEE wireless LAN devices use half-duplex communication. Half duplex is defined as two-way communication only one way at a time. Wired LANs can use full-duplex communication, which is two-way communication transmitting in both directions simultaneously. An example of diplex is to combine signals from two different frequencies into a single transmitter/receiver.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 2 :
_root.question = "DSSS devices operate in which frequency range?";
_root.answerA = "2.40 GHz";
_root.answerB = "5.25 GHz";
_root.answerC = "5.35 GHz";
_root.answerD = "5.75 GHz";
_root.correct = "A";
_root.explanation = "DSSS devices operate in the 2.4 to 2.5 GHz ISM band. OFDM devices operate in the 5GHz UNII bands.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 3 :
_root.question = "How many access points can be co-located without channel reuse in the same radio frequency area to maximize total system throughput while minimizing RF interference in an IEEE 802.11b network?";
_root.answerA = "Two";
_root.answerB = "Three";
_root.answerC = "Four";
_root.answerD = "Six";
_root.correct = "B";
_root.explanation = "802.11b operates in the 2.4 GHz ISM band. A total of three access points can be co-located before interference becomes an issue.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 4 :
_root.question = "Devices compliant with which amendment to the IEEE standard use multiple radio chains and multiple antennas?";
_root.answerA = "802.11a";
_root.answerB = "802.11b";
_root.answerC = "802.11g";
_root.answerD = "802.11n";
_root.correct = "D";
_root.explanation = "The IEEE 802.11n draft 2.0 amendment devices use MIMO, multiple radio chains, and antennas to operate. 802.11a/b/g devices use one radio and may use multiple antennas for diversity.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 5 :
_root.question = "What technology is used to send WLAN data over a wireless medium using many subcarrier frequencies?";
_root.answerA = "Wireless broadband";
_root.answerB = "Narrowband";
_root.answerC = "Spread spectrum";
_root.answerD = "Spectral masking";
_root.answerE = "Wideband";
_root.correct = "C";
_root.explanation = "Spread spectrum technology sends data over many subcarrier frequencies. Narrowband technology is not used in IEEE-based WLANs but is used in other technology such as radio and TV. Wireless broadband provides high-speed wireless data communications and wireless internet over a wide area network. Wideband uses a wide range of frequencies, and spectral mask refers to the signal levels of the radio frequency.";
_root.figure_flag = "False";
_root.question_type = "5R";
break;

case 6 :
_root.question = "Which two channels could be used so that the access points do not interfere with each other in an 802.11b wireless network? (Choose three.)";
_root.answerA = "Channel 1 and channel 5";
_root.answerB = "Channel 3 and channel 9";
_root.answerC = "Channel 6 and channel 11";
_root.answerD = "Channel 2 and channel 8";
_root.answerE = "Channel 4 and channel 7";
_root.correct = "BCD";
_root.explanation = "802.11b channels need to be separated by at least five channels or 25 MHz to be considered non-overlapping. Channels 3 and 9 are separated by six channels, channels 6 and 11 are separated by five channels, and channels 2 and 8 are separated by six channels. All of these scenarios are non-overlapping channels.";
_root.figure_flag = "False";
_root.question_type = "5MC";
break;

case 7 :
_root.question = "Which network access method attempts to avoid collisions?";
_root.answerA = "CSMA/CA";
_root.answerB = "CSMA/CD";
_root.answerC = "CSMA/CR";
_root.answerD = "CSMA/DSSS";
_root.correct = "A";
_root.explanation = "CSMA/CA uses collision avoidance. CSMA/CD uses collision detection. CSMA/CR and CSMA/DSSS do not exist.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 8 :
_root.question = "DSSS uses which spreading code at 1 Mbps?";
_root.answerA = "Barker";
_root.answerB = "CCK";
_root.answerC = "DBPSK";
_root.answerD = "DQPSK";
_root.correct = "A";
_root.explanation = "DSSS uses Barker code at 1 Mbps. CCK is for 5.5 Mbps. DBPSK and DQPSK are modulation technologies, not spreading codes.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 9 :
_root.question = "FM radio stations use what type of RF communication?";
_root.answerA = "High power, narrow bandwidth";
_root.answerB = "High power, wide bandwidth";
_root.answerC = "Low power, narrow bandwidth";
_root.answerD = "Low power, wide bandwidth";
_root.correct = "A";
_root.explanation = "FM radio stations use narrowband communication, which is high power and narrow frequency. WLANs use spread spectrum technology, which is low power and wide frequency.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 10 :
_root.question = "An HR/DSSS channel is how wide?";
_root.answerA = "1 MHz";
_root.answerB = "20 MHz";
_root.answerC = "22 MHz";
_root.answerD = "40 MHz";
_root.correct = "C";
_root.explanation = "HR/DSSS channels are 22 MHz wide. FHSS uses 1 MHz subcarrier frequencies. OFDM, ERP-OFDM, and HT-OFDM use 20 MHz&#8212;wide channels, and HT-OFDM can also use 40 MHz&#8212;wide channels.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 11 :
_root.question = "Bluetooth devices use ___________, which can potentially cause interference with WLANs.";
_root.answerA = "Bluetooth spread spectrum (BTSS)";
_root.answerB = "Orthogonal frequency division multiplexing (OFDM)";
_root.answerC = "Direct-sequence spread spectrum (DSSS)";
_root.answerD = "Frequency-hopping spread spectrum (FHSS)";
_root.correct = "D";
_root.explanation = "Bluetooth operates in the 2.4 GHz band and can cause interference with WLAN devices that operate in the 2.4 GHz band, including FHSS, DSSS, and OFDM.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 12 :
_root.question = "OFDM is used in 802.11a and 802.11g and supports a maximum data rate of _____ Mbps.";
_root.answerA = "11";
_root.answerB = "22";
_root.answerC = "33";
_root.answerD = "54";
_root.correct = "D";
_root.explanation = "OFDM can be used in 802.11a or 802.11g and supports a maximum data rate of 54 Mbps. 802.11b supports a maximum data rate of 11 Mbps. OFDM is also used with 802.11n Draft devices, but the maximum data rate is 300 Mbps.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 13 :
_root.question = "Which wireless LAN technology can be used to obtain the highest data transfer rate possible?";
_root.answerA = "DSSS";
_root.answerB = "Ethernet";
_root.answerC = "HT-OFDM";
_root.answerD = "OFDM";
_root.correct = "C";
_root.explanation = "HT-OFDM can support data rates as high as 300 Mbps, OFDM supports a maximum of 54 Mbps, and DSSS supports a maximum of 11 Mbps. Ethernet is not a wireless LAN technology.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 14 :
_root.question = "Which frequency ranges are used in an IEEE 802.11a-compliant wireless LAN? (Choose two.)";
_root.answerA = "900 MHz ISM range";
_root.answerB = "2.40 GHz ISM range";
_root.answerC = "5.25 GHz UNII range";
_root.answerD = "5.35 GHz UNII range";
_root.correct = "CD";
_root.explanation = "IEEE 802.11a wireless LANs operate in the 5 GHz UNII bands. 802.11b/g wireless LANs operate in the 2.4 GHz ISM band.";
_root.figure_flag = "False";
_root.question_type = "4MC";
break;

case 15 :
_root.question = "Which two IEEE 802.11 amendments are interoperable?";
_root.answerA = "802.11 and 802.11a";
_root.answerB = "802.11a and 802.11b";
_root.answerC = "802.11a and 802.11g";
_root.answerD = "802.11b and 802.11g";
_root.correct = "D";
_root.explanation = "IEEE 802.11b and 802.11g amendments are interoperable. 802.11a networks operate in the 5 GHz UNII bands and therefore are incompatible with 802.11b/g.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 16 :
_root.question = "Without any regulatory domain taken into consideration, the 2.4 GHz frequency range allows for how many channels using 802.11b?";
_root.answerA = "3";
_root.answerB = "6";
_root.answerC = "11";
_root.answerD = "14";
_root.correct = "D";
_root.explanation = "802.11b operates in the 2.4 GHz ISM band and will allow for 14 channels. The channels that can be used will depend on where the wireless LAN is located.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 17 :
_root.question = "FHSS uses which communication method to exchange data?";
_root.answerA = "1 MHz&#8212;wide subcarriers";
_root.answerB = "20 MHz&#8212;wide subcarriers";
_root.answerC = "22 MHz&#8212;wide subcarriers";
_root.answerD = "40 MHz&#8212;wide subcarriers";
_root.correct = "A";
_root.explanation = "FHSS uses 1 MHz subcarrier frequencies to transfer data. 20 MHz&#8212;wide, 22 MHz&#8212;wide, and 40 MHz&#8212;wide channels are used with other technologies.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 18 :
_root.question = "What is the maximum data rate of HR/DSSS 802.11b devices?";
_root.answerA = "5.5 Mbps";
_root.answerB = "11 Mbps";
_root.answerC = "24 Mbps";
_root.answerD = "54 Mbps";
_root.correct = "B";
_root.explanation = "The IEEE 802.11b amendment specifies data rate of 5.5 and 11 Mbps. OFDM allows for data rates up to 54 Mbps and is used in IEEE 802.11a and IEEE 802.11g amendments.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 19 :
_root.question = "What IEEE 802.11 spread spectrum technology specifies that frequencies change regularly while transmitting and receiving data?";
_root.answerA = "DSSS";
_root.answerB = "OFDM";
_root.answerC = "FHSS";
_root.answerD = "ERP-OFDM";
_root.correct = "C";
_root.explanation = "FHSS constantly changes frequencies while transmitting data in a WLAN. DSSS, OFDM, and MIMO use set channels and frequencies to transmit data.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 20 :
_root.question = "Which technology used in wireless LANs uses the effects of multipath to provide data rates of 300 Mbps?";
_root.answerA = "OFDM";
_root.answerB = "HR/DSSS";
_root.answerC = "HT/DSSS";
_root.answerD = "MIMO";
_root.correct = "D";
_root.explanation = "Current MIMO technology allows for up to 300 Mbps. One way this is accomplished is by using multipath as a benefit rather than a hindrance.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

	}
		
	QCounter.QCurrent.text = cur;
}

initialize();


//Change the following question numbers to the indicated question type!
//1. 4R
//2. 4R
//3. 4R
//4. 4R
//5. 5R
//6. 5MC
//7. 4R
//8. 4R
//9. 4R
//10. 4R
//11. 4R
//12. 4R
//13. 4R
//14. 4MC
//15. 4R
//16. 4R
//17. 4R
//18. 4R
//19. 4R
//20. 4R





//